package com.njtoyo.taxi.admin.rest.export.driver;

import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.Data;

import java.util.Date;

@Data
public class DriverListData {
    @ExcelProperty("司机ID")
    private Long id;

    @ExcelIgnore
    private Long cantonId;

    @ExcelProperty("地区")
    private String cantonName;

    @ExcelIgnore
    private Long driverRegionId;

    @ExcelProperty("司机运营区")
    private String driverRegionName;

    @ExcelProperty("公司名称")
    private String companyName;

    @ExcelProperty("司机姓名")
    private String name;

    @ExcelProperty("司机手机号")
    private String mobileNumber;

    @ExcelProperty("车牌号")
    private String taxiPlatNumber;

    @ExcelProperty("是否封号")
    private String isActive;

    @ExcelProperty("是否在线")
    private String inService;

    @ExcelProperty("是否离职")
    private String isLeave;

    @ExcelProperty("首次登录")
    private String loginOnce;

    @ExcelProperty("创建时间")
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    private Date createdAt;

    @ExcelProperty("更新时间")
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    private Date updatedAt;

    public void setIsActive(Boolean isActive) {
        this.isActive = isActive ? "否" : "是";
    }

    public void setInService(Boolean inService) {
        this.inService = inService ? "是" : "否";
    }

    public void setIsLeave(Boolean isLeave) {
        this.isLeave = isLeave ? "是" : "否";
    }

    public void setLoginOnce(Boolean loginOnce) {
        this.loginOnce = loginOnce ? "是" : "否";
    }
}
